#ifndef DATE_H
#define DATE_H

#include <QtGui>

#define D_MONDAY "Monday"
#define D_TUESDAY "Tuesday"
#define D_WEDNESDAY "Wednesday"
#define D_THURSDAY "Thursday"
#define D_FRIDAY "Friday"
#define D_SATURDAY "Saturday"
#define D_SUNDAY "Sunday"

enum Day
{
	MONDAY,
	TUESDAY,
	WEDNESDAY,
	THURSDAY,
	FRIDAY,
	SATURDAY,
	SUNDAY
};

static Day dayFromString( const QString& day )
{
	Day d = MONDAY;
	if( day == D_MONDAY )
	{
		d = MONDAY;
	}
	else if( day == D_TUESDAY )
	{
		d = TUESDAY;
	}
	else if( day == D_WEDNESDAY )
	{
		d = WEDNESDAY;
	}
	else if( day == D_THURSDAY )
	{
		d = THURSDAY;
	}
	else if( day == D_FRIDAY )
	{
		d = FRIDAY;
	}
	else if( day == D_SATURDAY )
	{
		d = SATURDAY;
	}
	else if( day == D_SUNDAY )
	{
		d = SUNDAY;
	}
	return d;
}

static Day getDay()
{
	Day d = MONDAY;

	QStringList items;
	items << D_MONDAY << D_TUESDAY << D_WEDNESDAY << D_THURSDAY << D_FRIDAY << D_SATURDAY << D_SUNDAY;
	bool ok;

	QString item = QInputDialog::getItem( NULL, "Select Day", "Day: ", items, 0, false, &ok );

	if( ok && !item.isEmpty() )
	{
		if( item == D_MONDAY )
		{
			d = MONDAY;
		}
		else if( item == D_TUESDAY )
		{
			d = TUESDAY;
		}
		else if( item == D_WEDNESDAY )
		{
			d = WEDNESDAY;
		}
		else if( item == D_THURSDAY )
		{
			d = THURSDAY;
		}
		else if( item == D_FRIDAY )
		{
			d = FRIDAY;
		}
		else if( item == D_SATURDAY )
		{
			d = SATURDAY;
		}
		else if( item == D_SUNDAY )
		{
			d = SUNDAY;
		}
	}

	return d;
}

#endif // DATE_H